package parrot.constructorWithParams;//start extract ParrotUser
import java.lang.reflect.*;
public class ParrotUser {
    static public void main( String[] args ) 
	    throws ClassNotFoundException,
		   InstantiationException,
		   IllegalAccessException,
		   NoSuchMethodException,
		   InvocationTargetException { 
	Class parrotClass = Class.forName( "ParrotImpl1" );
	Constructor pc 
	    = parrotClass.getConstructor( new Class[]{ String.class } );
	Parrot polly = (Parrot)pc.newInstance( new String[]{ "Polly" } );
	// Parrot object may now be used
    }
}
//stop extract ParrotUser

// how does one ensure that the object is properly initialized?
